package io.github.wanggit.antrpc.console.service;

import io.github.wanggit.antrpc.commons.lb.LoadBalancerDTO;
import io.github.wanggit.antrpc.console.service.dto.InterfaceCalledDetailsDTO;
import io.github.wanggit.antrpc.console.web.vo.InterfaceDetails;
import io.github.wanggit.antrpc.console.web.vo.MethodLimitVO;

import java.util.List;

public interface InterfaceService {

    void updateLoadbalancer(String className, String loadBalancer);

    void updateWeight(String clazz, String appNameHostPort, int weight);

    void classOnline(String appNameHostPort, String clazz);

    void classOffline(String appNameHostPort, String clazz);

    InterfaceDetails collectInterfaceDetails(String className);

    LoadBalancerDTO queryLoadBalancer(String className);

    List<InterfaceCalledDetailsDTO> queryInterfaceCalledDetails(
            String className, String appNameHostPort, String start, String end);

    void deleteZkNode(String path);

    void serviceProviderUpdateRateLimit(
            String className,
            String fullMethodName,
            Integer limit,
            Integer durationInSeconds,
            String appNameHostPort);

    List<MethodLimitVO> findConsumersByInterfaceName(String className, String fullMethodName);

    void serviceConsumerUpdateRateLimit(
            String className,
            String humanFullMethodName,
            Integer limit,
            Integer durationInSeconds,
            String appNameHostPort);
}
